package com.panshi.api;

import com.panshi.vo.qa.DataResultQA;
import com.panshi.vo.qa.Pages;
import com.panshi.vo.qa.QuestionAudit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "qa-server",contextId = "question-audit-api")
public interface IQuestionAuditApi {
    /*IQuestionAuditApi(问题审核Api)*/

    /**
     * 问题审核添加
     * @param questionAudit
     * @return
     */
    @PostMapping("/questionAudit/add")
    @ResponseBody
    DataResultQA addQuestionAudit(@RequestBody QuestionAudit questionAudit);

    /**
     * 问题审核分页查询
     * @param pages
     * @return
     */
    @PostMapping("/questionAudit/inquirePages")
    @ResponseBody
    DataResultQA<Pages<QuestionAudit>> inquirePagesQuestionAudit(@RequestBody Pages pages);

    /**
     * 查询记录总数
     * @param pages
     * @return
     */
    @PostMapping("/inquireQuestionAuditSum")
    @ResponseBody
    DataResultQA<Integer> inquireQuestionAuditSum(@RequestBody Pages pages);

    /**
     * 问题审核根据id查询
     * @param id
     * @return
     */
    @GetMapping("/questionAudit/inquireById/{id}")
    @ResponseBody
    DataResultQA<QuestionAudit> inquireByIdQuestionAudit(@PathVariable int id);

    /**
     * 问题审核修改
     * @param questionAudit
     * @return
     */
    @PostMapping("/questionAudit/update")
    @ResponseBody
    DataResultQA updateQuestionAudit(@RequestBody QuestionAudit questionAudit);

    /**
     * 问题审核删除（标记删除）
     * @param id
     * @return
     */
    @GetMapping("/questionAudit/delete/{id}")
    @ResponseBody
    DataResultQA deleteQuestionAudit(@PathVariable int id);

    /**
     * 问题审核(审核)
     * @param questionAudit
     * @return
     */
    @PostMapping("/questionAudit/updateState")
    @ResponseBody
    DataResultQA updateStateQuestionAudit(@RequestBody QuestionAudit questionAudit);

    /**
     * 用于用户查询自己发布的问题审核
     * @param userId
     * @return
     */
    @PostMapping("/questionAudit/inquireMyQuestionAudit/{id}")
    @ResponseBody
    DataResultQA<List<QuestionAudit>> inquireMyQuestionAudit(@PathVariable int userId);
}
